package com.example.logisticsingle.constants;

import lombok.Getter;

/**
 * 平台类型

 *
 */
public enum PlatformTypeEnum {
    PC(1,"PC"),
    APP(2,"APP"),
    ALL(3,"PC&APP");


    /**
     * 平台类型代码
     */
    @Getter
    private int code;
    /**
     * 平台类型名称
     */
    @Getter
    private String name;

    private PlatformTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }
    /**
     * 根据code获取去value
     * @param code
     * @return
     */
    public static String getValueByCode(int code){
        for(PlatformTypeEnum platform:PlatformTypeEnum.values()){
            if(code==platform.getCode()){
                return platform.getName();
            }
        }
        return  null;
    }

}
